/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CadastrarMotorista.java
 *
 * Created on 02/08/2011, 21:40:47
 */

package View.Seguro;

import Controle.Controlador;
import Modelo.*;
import Controle.Uteis;
import View.Cliente.CadastrarCliente;
import View.Fundo2;
import View.Motorista.CadastrarMotorista;
import View.Progress;
import View.TelaMetodos;
import View.Veiculo.CadastrarVeiculo;
import java.awt.BorderLayout;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Fernando Rocha
 */
public class CadastrarSeguro extends javax.swing.JFrame {
public static Fundo2 pnlFundo = new Fundo2();

    /** Creates new form CadastrarMotorista */
    public CadastrarSeguro() {
        initComponents();
        this.pack();
        this.setLayout(new BorderLayout());
        this.add(pnlFundo, BorderLayout.CENTER);
        this.setExtendedState(MAXIMIZED_BOTH);
        preencheTables(tabelaR);
        preencheTables(tabelaD);
        preencheTables(tabelaM);
        preencheTables(tabelaF);
        preencheTables(tabelaC);
        tabelaV.addColumn("Placa");
        tabelaV.addColumn("Modelo");
        tabelaV.addColumn("Proprietario");
        tabelaF.addColumn("Nome Faturante");
        tabelaC.addColumn("ValorFatura");
       
        InserirMercadorias();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        jButton1 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabelaRemetente = new javax.swing.JTable();
        pesquisaR = new javax.swing.JButton();
        buscaRemetente = new javax.swing.JTextField();
        nomeR = new javax.swing.JRadioButton();
        cnpjR = new javax.swing.JRadioButton();
        cpfR = new javax.swing.JRadioButton();
        jButton4 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tabelaDestinatario = new javax.swing.JTable();
        pesquisarD = new javax.swing.JButton();
        buscaDestinatario = new javax.swing.JTextField();
        nomeD = new javax.swing.JRadioButton();
        cnpjD = new javax.swing.JRadioButton();
        cpfD = new javax.swing.JRadioButton();
        jButton8 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        naturezaCarga = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        peso = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        especie = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        valorMercadoria = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        quantidade = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        notaFiscal = new javax.swing.JTextField();
        mercadoria = new javax.swing.JComboBox();
        novaMer = new javax.swing.JRadioButton();
        mercadorianova = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        novaMercadoria = new javax.swing.JTextField();
        inserirMercadoria = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        vendedor = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tabelaMotorista = new javax.swing.JTable();
        pesquisaMot = new javax.swing.JButton();
        buscaMotorista = new javax.swing.JTextField();
        nomeMot = new javax.swing.JRadioButton();
        cpfMot = new javax.swing.JRadioButton();
        jButton6 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tabelaVeiculo = new javax.swing.JTable();
        placa = new javax.swing.JRadioButton();
        renavam = new javax.swing.JRadioButton();
        buscaVei = new javax.swing.JTextField();
        pesquisaVeiculo = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        tabelaPesquisaFaturante = new javax.swing.JTable();
        nomeC = new javax.swing.JRadioButton();
        cpfC = new javax.swing.JRadioButton();
        cnpjC = new javax.swing.JRadioButton();
        buscaCliente = new javax.swing.JTextField();
        faturante = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        tabelaFaturantes = new javax.swing.JTable();
        jLabel7 = new javax.swing.JLabel();
        totFatura = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        valorFaturar = new javax.swing.JTextField();
        jButton5 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        CTRC = new javax.swing.JTextField();
        valorICMS = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        total = new javax.swing.JTextField();
        outros = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        valorSeguro = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jButton11 = new javax.swing.JButton();
        vp = new javax.swing.JRadioButton();
        pago = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        STRC = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        dataSeguro = new javax.swing.JFormattedTextField();
        jPanel12 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        remet = new javax.swing.JTextField();
        dest = new javax.swing.JTextField();
        mer = new javax.swing.JTextField();
        Vmer = new javax.swing.JTextField();
        mot = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        vei = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cadastrar seguro");

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icones/cadastrar.png"))); // NOI18N
        jButton1.setText("Cadastrar seguro");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jTabbedPane1.setBackground(new java.awt.Color(255, 255, 255));

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Rementente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(204, 0, 0))); // NOI18N

        tabelaRemetente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tabelaRemetente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaRemetenteMouseClicked(evt);
            }
        });
        tabelaRemetente.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                tabelaRemetenteAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        jScrollPane2.setViewportView(tabelaRemetente);

        pesquisaR.setText("Pesquisar");
        pesquisaR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pesquisaRActionPerformed(evt);
            }
        });

        nomeR.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(nomeR);
        nomeR.setText("Nome");

        cnpjR.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(cnpjR);
        cnpjR.setText("CNPJ");

        cpfR.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(cpfR);
        cpfR.setText("CPF");

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icones/cadastrar.png"))); // NOI18N
        jButton4.setText("Cadastrar Remetente");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                            .addComponent(nomeR)
                            .addGap(8, 8, 8)
                            .addComponent(cpfR)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cnpjR))
                        .addComponent(pesquisaR)
                        .addComponent(buscaRemetente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 598, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(107, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomeR)
                    .addComponent(cpfR)
                    .addComponent(cnpjR))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buscaRemetente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(pesquisaR)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(38, 38, 38)
                .addComponent(jButton4)
                .addContainerGap(197, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Remetente", jPanel2);

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Destinatário", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(204, 0, 0))); // NOI18N

        tabelaDestinatario.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tabelaDestinatario.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaDestinatarioMouseClicked(evt);
            }
        });
        tabelaDestinatario.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                tabelaDestinatarioAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        jScrollPane3.setViewportView(tabelaDestinatario);

        pesquisarD.setText("Pesquisar");
        pesquisarD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pesquisarDActionPerformed(evt);
            }
        });

        nomeD.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(nomeD);
        nomeD.setText("Nome");

        cnpjD.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(cnpjD);
        cnpjD.setText("CNPJ");

        cpfD.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(cpfD);
        cpfD.setText("CPF");

        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icones/cadastrar.png"))); // NOI18N
        jButton8.setText("Cadastrar Destinatário");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addComponent(nomeD)
                            .addGap(8, 8, 8)
                            .addComponent(cpfD)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cnpjD))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(pesquisarD)
                                .addComponent(buscaDestinatario, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(267, 267, 267)))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 635, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton8, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap(76, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomeD)
                    .addComponent(cpfD)
                    .addComponent(cnpjD))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buscaDestinatario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(pesquisarD)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton8)
                .addContainerGap(225, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Destinatário", jPanel3);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mercadoria e informações", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(204, 0, 0))); // NOI18N

        jPanel9.setBackground(new java.awt.Color(255, 255, 255));
        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mercadoria", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12), new java.awt.Color(204, 0, 0))); // NOI18N

        jLabel15.setText("Natureza da carga:");

        jLabel17.setText("Peso Kg:");

        jLabel16.setText("Espécie:");

        jLabel18.setText("Valor da mercadoria:");

        valorMercadoria.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                valorMercadoriaFocusLost(evt);
            }
        });

        jLabel20.setText("Mercadoria:");

        jLabel19.setText("Quantidade:");

        jLabel21.setText("Nota fiscal:");

        mercadoria.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ALHO", "CENOURA", "BATATA", "FEIJÃO", "SOJA", "ABACATE" }));
        mercadoria.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                mercadoriaFocusLost(evt);
            }
        });

        novaMer.setBackground(new java.awt.Color(255, 255, 255));
        novaMer.setText("Inserir Nova Mercadoria:");
        novaMer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                novaMerActionPerformed(evt);
            }
        });

        mercadorianova.setBackground(new java.awt.Color(255, 255, 255));
        mercadorianova.setEnabled(false);

        jLabel10.setText("Nome:");

        novaMercadoria.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        novaMercadoria.setEnabled(false);

        inserirMercadoria.setText("Inserir");
        inserirMercadoria.setEnabled(false);
        inserirMercadoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                inserirMercadoriaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout mercadorianovaLayout = new javax.swing.GroupLayout(mercadorianova);
        mercadorianova.setLayout(mercadorianovaLayout);
        mercadorianovaLayout.setHorizontalGroup(
            mercadorianovaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mercadorianovaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mercadorianovaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(inserirMercadoria)
                    .addComponent(novaMercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addContainerGap(87, Short.MAX_VALUE))
        );
        mercadorianovaLayout.setVerticalGroup(
            mercadorianovaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mercadorianovaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel10)
                .addGap(27, 27, 27)
                .addComponent(novaMercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addComponent(inserirMercadoria)
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jLabel6.setText("Vendedor:");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel15)
                        .addGroup(jPanel9Layout.createSequentialGroup()
                            .addGap(16, 16, 16)
                            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(peso, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(naturezaCarga, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(especie, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(valorMercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addComponent(jLabel17)
                        .addComponent(jLabel16)
                        .addComponent(jLabel18)
                        .addComponent(jLabel19))
                    .addComponent(jLabel21, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(quantidade, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(notaFiscal, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(103, 103, 103)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(mercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel20)))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(105, 105, 105)
                        .addComponent(novaMer))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(93, 93, 93)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(mercadorianova, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(vendedor, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(153, 153, 153))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addContainerGap(58, Short.MAX_VALUE)
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(mercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(novaMer)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(mercadorianova, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel9Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(naturezaCarga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(peso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(especie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(valorMercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(quantidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(notaFiscal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(vendedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(81, 81, 81))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 720, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(115, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Mercadoria e informações", jPanel1);

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Motorista", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(204, 0, 0))); // NOI18N

        tabelaMotorista.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tabelaMotorista.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaMotoristaMouseClicked(evt);
            }
        });
        tabelaMotorista.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                tabelaMotoristaAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        jScrollPane4.setViewportView(tabelaMotorista);

        pesquisaMot.setText("Pesquisar");
        pesquisaMot.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pesquisaMotActionPerformed(evt);
            }
        });

        nomeMot.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup3.add(nomeMot);
        nomeMot.setText("Nome");

        cpfMot.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup3.add(cpfMot);
        cpfMot.setText("CPF");

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icones/cadastrar.png"))); // NOI18N
        jButton6.setText("Cadastrar Motorista");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                            .addComponent(nomeMot)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(cpfMot))
                        .addComponent(pesquisaMot)
                        .addComponent(buscaMotorista, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 590, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(119, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nomeMot)
                    .addComponent(cpfMot))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buscaMotorista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pesquisaMot)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addComponent(jButton6)
                .addContainerGap(233, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Motorista", jPanel4);

        jPanel5.setBackground(new java.awt.Color(255, 255, 255));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Veículo", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(204, 0, 0))); // NOI18N

        tabelaVeiculo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tabelaVeiculo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaVeiculoMouseClicked(evt);
            }
        });
        tabelaVeiculo.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                tabelaVeiculoAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        jScrollPane5.setViewportView(tabelaVeiculo);

        placa.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup4.add(placa);
        placa.setText("Placa");

        renavam.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup4.add(renavam);
        renavam.setText("RENAVAM");

        pesquisaVeiculo.setText("Pesquisar");
        pesquisaVeiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pesquisaVeiculoActionPerformed(evt);
            }
        });

        jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icones/cadastrar.png"))); // NOI18N
        jButton10.setText("Cadastrar Veiculo");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(placa)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(renavam))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(pesquisaVeiculo)
                        .addComponent(buscaVei, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jButton10)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(155, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(placa)
                    .addComponent(renavam))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buscaVei, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pesquisaVeiculo)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43)
                .addComponent(jButton10)
                .addContainerGap(234, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Veículo", jPanel5);

        jPanel6.setBackground(new java.awt.Color(255, 255, 255));
        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Faturantes", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(204, 0, 0))); // NOI18N

        jPanel7.setBackground(new java.awt.Color(255, 255, 255));
        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Pesquisar faturante", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12), new java.awt.Color(204, 0, 0))); // NOI18N

        tabelaPesquisaFaturante.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane6.setViewportView(tabelaPesquisaFaturante);

        nomeC.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup5.add(nomeC);
        nomeC.setText("Nome");

        cpfC.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup5.add(cpfC);
        cpfC.setText("CPF");

        cnpjC.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup5.add(cnpjC);
        cnpjC.setText("CNPJ");

        faturante.setText("Pesquisar");
        faturante.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                faturanteActionPerformed(evt);
            }
        });

        jButton9.setText("Adicionar");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jPanel8.setBackground(new java.awt.Color(255, 255, 255));
        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Pesquisar faturante", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12), new java.awt.Color(204, 0, 0))); // NOI18N

        tabelaFaturantes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane7.setViewportView(tabelaFaturantes);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 481, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jLabel7.setText("Total da Fatura:");

        jButton2.setText("Calcular por valor fixo");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton7.setText("Calcular por taxa");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jLabel9.setText("Faturar Valor:");

        jButton5.setText("Faturar");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jLabel1.setText("CTRC:");

        valorICMS.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                valorICMSFocusLost(evt);
            }
        });

        jLabel2.setText("Valor ICMS:");

        jLabel5.setText("Total:");

        total.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                totalFocusGained(evt);
            }
        });

        outros.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                outrosFocusLost(evt);
            }
        });

        jLabel4.setText("Outros:");

        jLabel3.setText("Valor seguro:");

        jButton11.setText("Excluir");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        vp.setBackground(new java.awt.Color(255, 255, 255));
        vp.setText("Pago:");
        vp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vpActionPerformed(evt);
            }
        });

        pago.setEnabled(false);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(nomeC)
                        .addGap(8, 8, 8)
                        .addComponent(cpfC)
                        .addComponent(cnpjC))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 486, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(buscaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(40, 40, 40)
                        .addComponent(faturante))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(412, 412, 412)
                                .addComponent(jButton9))
                            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 510, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(valorFaturar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)
                            .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)
                            .addComponent(totFatura, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(CTRC, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(72, 72, 72)
                                .addComponent(valorSeguro, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addGap(154, 154, 154)
                                .addComponent(jLabel5))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(valorICMS, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(70, 70, 70)
                                .addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addGap(179, 179, 179)
                                .addComponent(jLabel3)))
                        .addGap(30, 30, 30)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel4)
                            .addComponent(outros, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                            .addComponent(vp)
                            .addComponent(pago))))
                .addGap(21, 21, 21))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nomeC)
                    .addComponent(cpfC)
                    .addComponent(cnpjC))
                .addGap(7, 7, 7)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buscaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(faturante))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addGap(29, 29, 29)
                        .addComponent(jButton7)))
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jButton9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(valorFaturar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(totFatura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(jLabel4))
                    .addComponent(jLabel1))
                .addGap(6, 6, 6)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(outros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CTRC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(valorSeguro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel5)
                        .addComponent(vp)))
                .addGap(6, 6, 6)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(valorICMS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(pago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(33, Short.MAX_VALUE))
        );

        jPanel8.getAccessibleContext().setAccessibleName("Pesquisar");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(36, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Fatura", jPanel6);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icones/voltar.png"))); // NOI18N
        jButton3.setText("Voltar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel8.setText("STRC:");

        STRC.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                STRCFocusLost(evt);
            }
        });

        jLabel11.setText("Data Seguro:");

        dataSeguro.setFormatterFactory((new javax.swing.text.DefaultFormatterFactory(Uteis.Mascara("##/##/####"))));

        jPanel12.setBackground(new java.awt.Color(255, 255, 255));
        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Informações Inseridas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12), new java.awt.Color(255, 51, 51))); // NOI18N

        jLabel12.setText("Remetente:");

        jLabel13.setText("Destinatario:");

        jLabel14.setText("Motorista:");

        jLabel23.setText("Valor da mercadoria:");

        jLabel24.setText("Veiculo");

        remet.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        remet.setEnabled(false);
        remet.setOpaque(false);

        dest.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        dest.setEnabled(false);
        dest.setOpaque(false);

        mer.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        mer.setEnabled(false);
        mer.setOpaque(false);

        Vmer.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        Vmer.setEnabled(false);
        Vmer.setOpaque(false);

        mot.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        mot.setEnabled(false);
        mot.setOpaque(false);

        jLabel25.setText("Mercadoria:");

        vei.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        vei.setEnabled(false);
        vei.setOpaque(false);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(mot)
                    .addComponent(Vmer)
                    .addComponent(mer)
                    .addComponent(dest)
                    .addComponent(jLabel12)
                    .addComponent(jLabel13)
                    .addComponent(remet, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                    .addComponent(jLabel25)
                    .addComponent(jLabel23)
                    .addComponent(jLabel24)
                    .addComponent(jLabel14)
                    .addComponent(vei))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jLabel12)
                .addGap(16, 16, 16)
                .addComponent(remet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel13)
                .addGap(8, 8, 8)
                .addComponent(dest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel25)
                .addGap(7, 7, 7)
                .addComponent(mer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel23)
                .addGap(13, 13, 13)
                .addComponent(Vmer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel14)
                .addGap(11, 11, 11)
                .addComponent(mot, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel24)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(vei, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(STRC, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(8, 8, 8))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jPanel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(dataSeguro, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
                            .addComponent(jLabel11))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 748, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(STRC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dataSeguro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 659, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void preencheTables(DefaultTableModel tabela){
         tabela.addColumn("Nome ");
        tabela.addColumn("Endereço ");
        tabela.addColumn("Cidade");
    }

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
              TelaMetodos.Dispose(this);

    }//GEN-LAST:event_jButton3ActionPerformed

     public int selecaoD(){
        if(nomeD.isSelected())
            return 3;
        if(cpfD.isSelected())
            return 2;
        if(cnpjD.isSelected())
            return 2;
        return 0;
    }

    public int selecaoMotorista(){
        if(cpfMot.isSelected())
            return 2;
        else if(nomeMot.isSelected())
            return 3;
        return 0;
    }

    public int selecaoVeiculo(){
        if(placa.isSelected())
            return 1;
        else if(renavam.isSelected())
            return 2;
        return 0;
    }

      public int selecaoC(){
        if(nomeD.isSelected())
            return 3;
        if(cpfD.isSelected())
            return 2;
        if(cnpjD.isSelected())
            return 2;
        return 0;
    }

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

          final Progress p = new Progress();
          p.setVisible(true);
          SwingWorker worker = new SwingWorker(){
               @Override
               protected Object doInBackground() throws Exception {
                    cadastroSeg(); // meu processo demorado
                    return null;
               }
               @Override
               protected void done() {
                    p.setVisible(false);
               }
          };
          worker.execute();
    }//GEN-LAST:event_jButton1ActionPerformed

    public void cadastroSeg(){
        String result="erro ao cadastrar";
    if(tabelaRemetente.getSelectedRow()!=-1 && tabelaDestinatario.getSelectedRow()!=-1 && tabelaVeiculo.getSelectedRow()!=-1 && tabelaMotorista.getSelectedRow()!=-1){
        if(verificaDados()){
            if(Uteis.transformaFloat(total.getText()) == Uteis.transformaFloat(totFatura.getText())){
                valores.addAll(Faturas());
                if(valores.size()>0){
                /*(String naturezaCarga,String especie,String quantidade,
                     String notaFiscal,String nome, String valorMercadoria, String peso,String CTRC, String valorICMS,
                     String valorSeguro,String outros,String total,String STRC,
                     String dataSeguro, Cliente remetente,Cliente destinatario, Veiculo veiculo, Motorista motorista){*/

                     Seguro seg = Controlador.cadastroSeguro(naturezaCarga.getText(),especie.getText(),quantidade.getText(),
                     notaFiscal.getText(),mercadoria.getItemAt(mercadoria.getSelectedIndex()).toString(),valorMercadoria.getText(),peso.getText(),CTRC.getText(),valorICMS.getText(),
                     valorSeguro.getText(),outros.getText(),total.getText(),STRC.getText(),
                     dataSeguro.getText(), remetente.get(tabelaRemetente.getSelectedRow()),destinatario.get(tabelaDestinatario.getSelectedRow()),
                     veiculo.get(tabelaVeiculo.getSelectedRow()),motorista.get(tabelaMotorista.getSelectedRow()),vendedor.getText());
                    if(seg!=null){
                        if(Uteis.transformaFloat(pago.getText())<=Uteis.transformaFloat(totFatura.getText()))
                             result = Controlador.cliente_has_Seguro(faturantes,seg,valores,pago.getText());
                        else
                            result = "corrija o valor pago";
                        JOptionPane.showMessageDialog(null, result);
                        if(result.equals("Cadastro realizado com sucesso")){
                              removeTodosDados();
                        }
                    }
                }else
                    JOptionPane.showMessageDialog(null, "nao existe valores faturados");

            }else{
                JOptionPane.showMessageDialog(null,"valores de fatura e total não batem");
            }
        }
        }else{
            JOptionPane.showMessageDialog(null, "Falta dados a serem selecionados");
        }
    }

    public void removeTodosDados(){
        TelaMetodos.Texto(this.getContentPane());
        valores.clear();
        faturantes.clear();
        TelaMetodos.RemoveDadosTabela(tabelaD, tabelaDestinatario);
        TelaMetodos.RemoveDadosTabela(tabelaR, tabelaRemetente);
        TelaMetodos.RemoveDadosTabela(tabelaM, tabelaMotorista);
        TelaMetodos.RemoveDadosTabela(tabelaV, tabelaVeiculo);
        TelaMetodos.RemoveDadosTabela(tabelaF, tabelaPesquisaFaturante);
        TelaMetodos.RemoveDadosTabela(tabelaC, tabelaFaturantes);
    }

    private void outrosFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_outrosFocusLost
        total.setText(somarTodos());
}//GEN-LAST:event_outrosFocusLost

    private void totalFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_totalFocusGained
        total.setText(somarTodos());
}//GEN-LAST:event_totalFocusGained

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        if(tabelaFaturantes.getSelectedRow()!=-1){
            tabelaFaturantes.setValueAt(valorFaturar.getText(),tabelaFaturantes.getSelectedRow(),3);
            totFatura.setText(somar());
        }
        valorFaturar.setText("");
}//GEN-LAST:event_jButton5ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        if(tabelaFaturantes.getSelectedRow()!=-1){
            if(Uteis.transformaFloat(valorMercadoria.getText())>0)
                valorSeguro.setText(Uteis.Num(faturantes.get(tabelaFaturantes.getSelectedRow()).calculo(Uteis.transformaFloat(valorMercadoria.getText()), 1)));
            else
                JOptionPane.showMessageDialog(null,"Entre com o valor da mercadoria");
        }else
            JOptionPane.showMessageDialog(null, "Escolha um faturante");
}//GEN-LAST:event_jButton7ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        if(tabelaFaturantes.getSelectedRow()!=-1){
            if(Uteis.transformaFloat(valorMercadoria.getText())>0)
                valorSeguro.setText(Uteis.Num(faturantes.get(tabelaFaturantes.getSelectedRow()).calculo(Uteis.transformaFloat(valorMercadoria.getText()), 2)));
            else
                JOptionPane.showMessageDialog(null, "Entre com o valor da mercadoria");
        }else
            JOptionPane.showMessageDialog(null, "Escolha um faturante");
}//GEN-LAST:event_jButton2ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        if(tabelaFaturantes.getSelectedRow()!=-1){
            int remover = tabelaFaturantes.getSelectedRow();
            tabelaC.removeRow(remover);
            faturantes.remove(remover);
        }
}//GEN-LAST:event_jButton11ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        if(tabelaPesquisaFaturante.getSelectedRow()!=-1){
            if(clientes.get(tabelaPesquisaFaturante.getSelectedRow()) instanceof Juridico){
                Juridico jur = (Juridico)clientes.get(tabelaPesquisaFaturante.getSelectedRow());
                tabelaC.addRow(new String[] {jur.getPessoa().getNome(),jur.getPessoa().getEndereco(),jur.getPessoa().getCidade()," "});
                faturantes.add(jur);
            }else if(clientes.get(tabelaPesquisaFaturante.getSelectedRow()) instanceof Fisico){
                Fisico fis = (Fisico)clientes.get(tabelaPesquisaFaturante.getSelectedRow());
                tabelaC.addRow(new String[]{fis.getPessoa().getNome(),fis.getPessoa().getEndereco(),fis.getPessoa().getCidade()," "});
                faturantes.add(fis);
            }
            tabelaFaturantes.setModel(tabelaC);
        }
}//GEN-LAST:event_jButton9ActionPerformed

    private void faturanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_faturanteActionPerformed
        final Progress p = new Progress();
          p.setVisible(true);
          SwingWorker worker = new SwingWorker(){
               @Override
               protected Object doInBackground() throws Exception {
                    preencheFaturantes(); // meu processo demorado
                    return null;
               }
               @Override
               protected void done() {
                    p.setVisible(false);
               }
          };
          worker.execute();
}//GEN-LAST:event_faturanteActionPerformed

    public void preencheFaturantes(){
        clientes.clear();
        TelaMetodos.RemoveDadosTabela(tabelaF, tabelaPesquisaFaturante);
        int tipo = selecaoC();
        clientes.addAll(Controlador.consultaCliente(buscaCliente.getText(), tipo));
        if(clientes.size()>0){
            for(Cliente c:clientes){
                if(c instanceof Juridico){
                    Juridico jur = (Juridico)c;
                    tabelaF.addRow(new String[] {jur.getPessoa().getNome(),jur.getPessoa().getEndereco(),jur.getPessoa().getCidade(),jur.getNomeFaturante()});
                }else if(c instanceof Fisico){
                    Fisico fis = (Fisico)c;
                    tabelaF.addRow(new String[]{fis.getPessoa().getNome(),fis.getPessoa().getEndereco(),fis.getPessoa().getCidade(),fis.getNomeFaturante()});
                }
                tabelaPesquisaFaturante.setModel(tabelaF);
            }
        }else{
            JOptionPane.showMessageDialog(null, "Não foi encontrado informações com esse dado");
        }
    }

    private void pesquisaVeiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pesquisaVeiculoActionPerformed
         final Progress p = new Progress();
          p.setVisible(true);
          SwingWorker worker = new SwingWorker(){
               @Override
               protected Object doInBackground() throws Exception {
                    preencheVeiculo(); // meu processo demorado
                    return null;
               }
               @Override
               protected void done() {
                    p.setVisible(false);
               }
          };
          worker.execute();
}//GEN-LAST:event_pesquisaVeiculoActionPerformed
    public void preencheVeiculo(){
        veiculo.clear();
         TelaMetodos.RemoveDadosTabela(tabelaV, tabelaVeiculo);
        int tipo = selecaoVeiculo();
        veiculo.addAll(Controlador.buscarVeiculo(buscaVei.getText(),tipo));
        if(veiculo.size()>0 && veiculo !=null){
            for(Veiculo v:veiculo){
                tabelaV.addRow(new String[] {v.getPlaca(),v.getModelo(),v.getPro().getNome()});
            }
        }
    }
    private void tabelaVeiculoAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_tabelaVeiculoAncestorAdded
        tabelaVeiculo.setModel(tabelaV);
}//GEN-LAST:event_tabelaVeiculoAncestorAdded

    private void tabelaVeiculoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaVeiculoMouseClicked
        if(tabelaVeiculo.getSelectedRow()!=-1){
            vei.setText(tabelaVeiculo.getValueAt(tabelaVeiculo.getSelectedRow(), 0).toString());
        }
}//GEN-LAST:event_tabelaVeiculoMouseClicked

    private void pesquisaMotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pesquisaMotActionPerformed
          final Progress p = new Progress();
          p.setVisible(true);
          SwingWorker worker = new SwingWorker(){
               @Override
               protected Object doInBackground() throws Exception {
                    preencheMotorista(); // meu processo demorado
                    return null;
               }
               @Override
               protected void done() {
                    p.setVisible(false);
               }
          };
          worker.execute();
}//GEN-LAST:event_pesquisaMotActionPerformed

    public void preencheMotorista(){
         motorista.clear();
         TelaMetodos.RemoveDadosTabela(tabelaM, tabelaMotorista);
        int tipo=selecaoMotorista();
        motorista.addAll(Controlador.consultarMotorista(buscaMotorista.getText(),tipo));
        if( motorista.size()>0 && motorista !=null){
            for(Motorista m:motorista){
                tabelaM.addRow(new String[] {m.getNome(),m.getEndereco(),m.getCidade()});
            }
        }
    }

    private void tabelaMotoristaAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_tabelaMotoristaAncestorAdded
        tabelaMotorista.setModel(tabelaM);      // TODO add your handling code here:
}//GEN-LAST:event_tabelaMotoristaAncestorAdded

    private void tabelaMotoristaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaMotoristaMouseClicked
        if(tabelaMotorista.getSelectedRow()!=-1){
            mot.setText(tabelaMotorista.getValueAt(tabelaMotorista.getSelectedRow(), 0).toString());
        }
}//GEN-LAST:event_tabelaMotoristaMouseClicked

    private void mercadoriaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_mercadoriaFocusLost
        mer.setText(mercadoria.getItemAt(mercadoria.getSelectedIndex()).toString());
}//GEN-LAST:event_mercadoriaFocusLost

    private void valorMercadoriaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorMercadoriaFocusLost
        Vmer.setText(valorMercadoria.getText());
}//GEN-LAST:event_valorMercadoriaFocusLost

    private void pesquisarDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pesquisarDActionPerformed
         final Progress p = new Progress();
          p.setVisible(true);
          SwingWorker worker = new SwingWorker(){
               @Override
               protected Object doInBackground() throws Exception {
                    preencheDestinatario(); // meu processo demorado
                    return null;
               }
               @Override
               protected void done() {
                    p.setVisible(false);
               }
          };
          worker.execute();
}//GEN-LAST:event_pesquisarDActionPerformed
    public void preencheDestinatario(){
         destinatario.clear();
         TelaMetodos.RemoveDadosTabela(tabelaD, tabelaDestinatario);
        int tipo = selecaoD();
        destinatario.addAll(Controlador.consultaCliente(buscaDestinatario.getText(), tipo));
        if(destinatario.size()>0){
            for(Cliente c:destinatario){
                if(c instanceof Juridico){
                    Juridico jur = (Juridico)c;
                    tabelaD.addRow(new String[] {jur.getPessoa().getNome(),jur.getPessoa().getEndereco(),jur.getPessoa().getCidade()});
                }else if(c instanceof Fisico){
                    Fisico fis = (Fisico)c;
                    tabelaD.addRow(new String[]{fis.getPessoa().getNome(),fis.getPessoa().getEndereco(),fis.getPessoa().getCidade()});
                }
            }
        }else{
            JOptionPane.showMessageDialog(null, "Não foi encontrado informações com esse dado");
        }
    }
    private void tabelaDestinatarioAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_tabelaDestinatarioAncestorAdded

        tabelaDestinatario.setModel(tabelaD);

        // TODO add your handling code here:
}//GEN-LAST:event_tabelaDestinatarioAncestorAdded

    private void tabelaDestinatarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaDestinatarioMouseClicked
        if(tabelaDestinatario.getSelectedRow()!=-1){
            dest.setText(tabelaDestinatario.getValueAt(tabelaDestinatario.getSelectedRow(), 0).toString());
        }
}//GEN-LAST:event_tabelaDestinatarioMouseClicked

    private void pesquisaRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pesquisaRActionPerformed
          final Progress p = new Progress();
          p.setVisible(true);
          SwingWorker worker = new SwingWorker(){
               @Override
               protected Object doInBackground() throws Exception {
                    preencheRemetente(); // meu processo demorado
                    return null;
               }
               @Override
               protected void done() {
                    p.setVisible(false);
               }
          };
          worker.execute();
        
}//GEN-LAST:event_pesquisaRActionPerformed
    public void preencheRemetente(){
        remetente.clear();
        TelaMetodos.RemoveDadosTabela(tabelaR, tabelaRemetente);
        int tipo = selecaoD();
        remetente.addAll(Controlador.consultaCliente(buscaRemetente.getText(), tipo));
        if(remetente.size()>0){
            for(Cliente c:remetente){
                if(c instanceof Juridico){
                    Juridico jur = (Juridico)c;
                    tabelaR.addRow(new String[] {jur.getPessoa().getNome(),jur.getPessoa().getEndereco(),jur.getPessoa().getCidade()});
                }else if(c instanceof Fisico){
                    Fisico fis = (Fisico)c;
                    tabelaR.addRow(new String[]{fis.getPessoa().getNome(),fis.getPessoa().getEndereco(),fis.getPessoa().getCidade()});
                }
            }
        }else{
            JOptionPane.showMessageDialog(null, "Não foi encontrado informações com esse dado");
        }
    }
    private void tabelaRemetenteAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_tabelaRemetenteAncestorAdded
        tabelaRemetente.setModel(tabelaR);
    }//GEN-LAST:event_tabelaRemetenteAncestorAdded

    private void tabelaRemetenteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaRemetenteMouseClicked
        if(tabelaRemetente.getSelectedRow()!=-1){
            remet.setText(tabelaRemetente.getValueAt(tabelaRemetente.getSelectedRow(), 0).toString());
        }
}//GEN-LAST:event_tabelaRemetenteMouseClicked

    private void novaMerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_novaMerActionPerformed
       if(novaMer.isSelected()){
            novaMercadoria.setEnabled(true);
            inserirMercadoria.setEnabled(true);
       }else{
            novaMercadoria.setEnabled(false);
            inserirMercadoria.setEnabled(false);
       }
    }//GEN-LAST:event_novaMerActionPerformed

    private void valorICMSFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorICMSFocusLost
        total.setText(somarTodos());
    }//GEN-LAST:event_valorICMSFocusLost

    private void STRCFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_STRCFocusLost
        STRC.setText(Uteis.modSTRC(STRC.getText()));
        if(Controlador.validaSTRC(STRC.getText()))
            JOptionPane.showMessageDialog(null, "STRC invalido");
    }//GEN-LAST:event_STRCFocusLost

    private void inserirMercadoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inserirMercadoriaActionPerformed
        if(!novaMercadoria.getText().equals("")){
          InserirMercadorias();
        }
    }//GEN-LAST:event_inserirMercadoriaActionPerformed

    private void vpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vpActionPerformed
        if(vp.isSelected())
            pago.setEnabled(true);
        else if( vp.isSelected()==false)
            pago.setEnabled(false);
            
    }//GEN-LAST:event_vpActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
       CadastrarCliente cli = new CadastrarCliente(1);
       cli.setVisible(true);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
       CadastrarCliente cli = new CadastrarCliente(1);
       cli.setVisible(true);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
       CadastrarMotorista mot = new CadastrarMotorista(1);
       mot.setVisible(true);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        CadastrarVeiculo vei = new CadastrarVeiculo(1);
        vei.setVisible(true);
    }//GEN-LAST:event_jButton10ActionPerformed

    public String somarTodos(){
         float vl = Uteis.transformaFloat(valorSeguro.getText());
         float out = Uteis.transformaFloat(outros.getText());
         float icms = Uteis.transformaFloat(valorICMS.getText());
         float result = vl+out+icms;
         String valorFinal = Float.toString(result);
         return valorFinal;
    }

    public String somar(){
         float temp=0;
         for(int i=0; i<tabelaFaturantes.getRowCount();i++)
            temp+=Uteis.transformaFloat(tabelaFaturantes.getValueAt(i, 3).toString());
        return Uteis.Num(temp);
    }

    public ArrayList<Float> Faturas(){

         ArrayList<Float> temp= new ArrayList<Float>();
         if(tabelaFaturantes.getModel().getColumnCount()>0){
               for(int i=0; i<tabelaFaturantes.getRowCount();i++)
                        temp.add(Uteis.transformaFloat(tabelaFaturantes.getValueAt(i, 3).toString()));
         } else {
                    temp.clear();
                }
          
               
         return temp;
    }

    public boolean verificaDados(){
        if(!Uteis.soContemNumeros(valorMercadoria.getText())){
                JOptionPane.showMessageDialog(null,"erro no valor da mercadoria");
                return false;
        }else  if (!Uteis.soContemNumeros(valorICMS.getText())){
                JOptionPane.showMessageDialog(null,"erro no ICMS");
                return false;
        }else if (!Uteis.soContemNumeros(valorSeguro.getText())){
                JOptionPane.showMessageDialog(null,"erro no valor do seguro");
                return false;
        }else if(!Uteis.soContemNumeros(outros.getText())){
                JOptionPane.showMessageDialog(null,"erro no valor outros");
                return false;
        }else if(!Uteis.soContemNumeros(total.getText())){
                JOptionPane.showMessageDialog(null,"erro no valor total");
                return false;
        }else if(STRC == null || STRC.equals("")){
                 JOptionPane.showMessageDialog(null,"STRC invalido");
            return false;
        }
        return true;
    }

    
    public void InserirMercadorias(){
          String [] resultado = null;
            try {
                resultado=Controlador.InserirNovaMercadoria(novaMercadoria.getText());
            } catch (SQLException ex) {
               JOptionPane.showMessageDialog(null, ex.getMessage());
            }
            mercadoria.removeAllItems();
            for(String s:resultado){
                mercadoria.addItem(s);
        }
    }

    /**
    * @param args the command line arguments
    */
    
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CadastrarSeguro().setVisible(true);
            }
        });
    }

    private ArrayList<Float> valores = new ArrayList<Float>();
    private DefaultTableModel tabelaR = new DefaultTableModel();
    private DefaultTableModel tabelaD = new DefaultTableModel();
    private DefaultTableModel tabelaM = new DefaultTableModel();
    private DefaultTableModel tabelaV = new DefaultTableModel();
    private DefaultTableModel tabelaF = new DefaultTableModel();
    private DefaultTableModel tabelaC = new DefaultTableModel();
    private ArrayList<Cliente> faturantes = new ArrayList<Cliente>();
    private ArrayList<Cliente> clientes = new ArrayList<Cliente>();
    private ArrayList<Cliente> destinatario = new ArrayList<Cliente>();
    private ArrayList<Cliente> remetente = new ArrayList<Cliente>();
    private ArrayList<Veiculo> veiculo = new ArrayList<Veiculo>();
    private ArrayList<Motorista> motorista = new ArrayList<Motorista>();

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField CTRC;
    private javax.swing.JTextField STRC;
    private javax.swing.JTextField Vmer;
    private javax.swing.JTextField buscaCliente;
    private javax.swing.JTextField buscaDestinatario;
    private javax.swing.JTextField buscaMotorista;
    private javax.swing.JTextField buscaRemetente;
    private javax.swing.JTextField buscaVei;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private javax.swing.JRadioButton cnpjC;
    private javax.swing.JRadioButton cnpjD;
    private javax.swing.JRadioButton cnpjR;
    private javax.swing.JRadioButton cpfC;
    private javax.swing.JRadioButton cpfD;
    private javax.swing.JRadioButton cpfMot;
    private javax.swing.JRadioButton cpfR;
    private javax.swing.JFormattedTextField dataSeguro;
    private javax.swing.JTextField dest;
    private javax.swing.JTextField especie;
    private javax.swing.JButton faturante;
    private javax.swing.JButton inserirMercadoria;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField mer;
    private javax.swing.JComboBox mercadoria;
    private javax.swing.JPanel mercadorianova;
    private javax.swing.JTextField mot;
    private javax.swing.JTextField naturezaCarga;
    private javax.swing.JRadioButton nomeC;
    private javax.swing.JRadioButton nomeD;
    private javax.swing.JRadioButton nomeMot;
    private javax.swing.JRadioButton nomeR;
    private javax.swing.JTextField notaFiscal;
    private javax.swing.JRadioButton novaMer;
    private javax.swing.JTextField novaMercadoria;
    private javax.swing.JTextField outros;
    private javax.swing.JTextField pago;
    private javax.swing.JTextField peso;
    private javax.swing.JButton pesquisaMot;
    private javax.swing.JButton pesquisaR;
    private javax.swing.JButton pesquisaVeiculo;
    private javax.swing.JButton pesquisarD;
    private javax.swing.JRadioButton placa;
    private javax.swing.JTextField quantidade;
    private javax.swing.JTextField remet;
    private javax.swing.JRadioButton renavam;
    private javax.swing.JTable tabelaDestinatario;
    private javax.swing.JTable tabelaFaturantes;
    private javax.swing.JTable tabelaMotorista;
    private javax.swing.JTable tabelaPesquisaFaturante;
    private javax.swing.JTable tabelaRemetente;
    private javax.swing.JTable tabelaVeiculo;
    private javax.swing.JTextField totFatura;
    private javax.swing.JTextField total;
    private javax.swing.JTextField valorFaturar;
    private javax.swing.JTextField valorICMS;
    private javax.swing.JTextField valorMercadoria;
    private javax.swing.JTextField valorSeguro;
    private javax.swing.JTextField vei;
    private javax.swing.JTextField vendedor;
    private javax.swing.JRadioButton vp;
    // End of variables declaration//GEN-END:variables

}
